package com.github.tvbox.osc.ui.details;

import java.util.List;

import androidx.fragment.app.Fragment;

/**
 * @ClassName: DetailsFragment
 * @Description: TODO(详情 ， 提供基本的显示和操作 ， 具体的交由子类去完成)
 * @author: huangrongcai
 * @date: 2024/6/30
 * @Copyright: 黄嵘才（HuangRc)
 */
public abstract class DetailsFragment<T> extends Fragment implements IMediaDisplay.Base, IMediaAction {
    /*压弹入膛*/

    private void showAllDetails(T detail, IMediaAction action) {
        if (detail != null) {
            //媒体文件多样化，怎么样去多样化处理呢？
            showMediaDetails(detail);
            //去获取准备好的操作
            fetchMediaPlaySource();
        } else {
            throw new IllegalArgumentException("MovieDetail cannot be null");
        }
    }

    private void fetchMediaPlaySource() {
        //获取媒体播放源
    }

    /*压弹入膛*/
    protected void showMediaDetails(T detail) {
        //显示媒体详情
    }

    /**
     * 自动播放
     */
    public void performPlayAuto() {
    }

    /**
     *
     * 出错时自动尝试下一个播放源
     */
    public void performPlayOnSiteError() {
    }

    public void display推荐(String recommend) {
    }

    public void displayTitle(String title) {

    }

    @Override
    public void displayPoster(String poster) {

    }

    @Override
    public void displayActors(List<String> actors) {

    }

    @Override
    public void displayDirector(String director) {

    }

    @Override
    public void displayRating(double rating) {

    }

    @Override
    public void displayIntroduction(String introduction) {

    }

    @Override
    public void performAction(IMediaAction action) {

    }


    /*发射*/
    @Override
    public void play() {

    }

    @Override
    public void collect() {

    }


    /*发射*/
    protected void performPlay() {
        //播放
    }
}
